<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

	<head>
		<title>[%$ESPCMS_SOFT_TITLE%]</title>
		<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/espcms_style_font_icon.css" rel="stylesheet" type="text/css" />
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/espcms_style_public.css" rel="stylesheet" type="text/css" />
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/espcms_all.css" rel="stylesheet" type="text/css" />
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/espcms_framework.css" rel="stylesheet" type="text/css" />
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/espcms_select.css" rel="stylesheet" type="text/css" />
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/pageload.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/jquery.min.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/jquery-ui.min.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/jquery.cookie.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_dialog.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/md5.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/json.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/bootstrap.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/lngpack_cn.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_form.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_formvalidation.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_dialog.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_function.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_tool.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_page.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_select.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_checkbox.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_select_checkbox.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_batch.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_tab.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/nprogress.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/iframeResizer.contentWindow.min.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_multiple.js"></script>
		<script type="text/javascript">
			$(document).ready(function () {
				banpageKey();
				$("[placeholder]").tooltip();
				$('input[type=checkbox],input[type=radio]').espcms_checkbox();
				$("#espcms_saveInfo").espcms_formvalidation({focusName: "#keywordname_0"});
				$('#espcms_saveInfo').ajaxForm({
					type: 'POST',
					url: '[%$link.save%]',
					dataType: 'json',
					beforeSubmit: function () {
						parent.espcms_are_loading();
					},
					success: function (data) {
						parent.$("#espcms_are_loading").dialog("close");
						parent.$("body").append(data.data);
						if (data.code === 'true') {
							save_ok(data);
						} else {
							var botton = [
								{
									text: "[%pack:botton_pack-espcms_botton_colse%]",
									class: "btn btn-lightgray",
									click: function () {
										parent.$(this).dialog("close");
										parent.$(this).espcms_window_tab('close', {'iframeName': '[%$iframes_name%]'});
									}
								}
							];
							parent.espcms_public_dialog(data.domid_name, botton, 600);
						}
						$(window).unbind('beforeunload');
					}
				});
				$('.espcms_save_cancel').espcms_window_tab('closeTab');
				load_tabclick('.tab_click');
				$('#add_item').click(function () {
					var li_count = $('#add_list_id').val();
					var li_id = parseInt(li_count) + 1;
					var html = '<li class="item_input" id="item_input_' + li_id + '">' +
						'	<div class="controls">' +
						'		<input type="text" name="keywordname[]" class="form-control" id="keywordname_' + li_id + '" maxlength="50" data-validation-minlength="2" data-validation-maxlength="50" data-msg-cssname="controls" placeholder="[%pack:article_pack-espcms_keywords_optimization_keywordname_title%]" title="[%pack:article_pack-espcms_keywords_optimization_keywordname_title%]" data-validation-msg="[%pack:article_pack-espcms_keywords_optimization_keywordname_validation_msg%]"/>' +
						'		<a title="[%pack:botton_pack-espcms_botton_del%]" class="del_botton item_del_botton icon_botton" item-remove="' + li_id + '"><i class="espcms_icon_fa espcms_icon_fa-trash"></i></a>' +
						'	</div>' +
						'</li>';
					$('#item_list').append(html);
					$('#add_list_id').val(li_id);
					$("#espcms_saveInfo").espcms_formvalidation();
					$('.item_del_botton').click(function () {
						var del_id = $(this).attr('item-remove');
						var del_div = '#item_input_' + del_id;
						li_id = li_id - 1;
						$('#add_list_id').val(li_id);
						$(del_div).remove();
						return false;
					});
				});
			});

			function save_ok(data) {
				parent.$.espcms_sticky(data.message, {'autoclose': 3000});
				parent.frames['[%$par_iframes_name%]'].add_loading('ajax_list');
				parent.window.frames['[%$iframes_name%]'].location.reload();
			}
		</script>
	</head>

	<body class="espcms_style_all">
		<div class="main">
			<div class="espcms_center_content_list">

				<div class="panel">
					<div class="panel-body form_bottom_page">
						<form class="form-horizontal admin-form" id="espcms_saveInfo" action="[%$link.save%]">
							<input type="hidden" name="token_key" id="token_key" value="[%$token.token_key%]"/>
							<input type="hidden" name="token_name" id="token_name" value="[%$token.token_name%]"/>
							<div class="section-divider mb40"><span>[%pack:article_pack-espcms_keywords_optimization_button_add%]</span></div>
							<div class="form-group">
								<label class="col-sm-2 control-label">[%pack:article_pack-espcms_keywords_optimization_keywordname%]</label>
								<div class="col-sm-9">
									<input type="text" name="keywordname[]" class="form-control" id="keywordname_0" maxlength="50" data-validation-minlength="2" data-validation-maxlength="50" placeholder="[%pack:article_pack-espcms_keywords_optimization_keywordname_title%]" title="[%pack:article_pack-espcms_keywords_optimization_keywordname_title%]" data-validation-msg="[%pack:article_pack-espcms_keywords_optimization_keywordname_validation_msg%]"/>
									<input type="hidden" name="add_list_id" id="add_list_id" validation="true" data-validation-botton="add_item" data-validation="^[0-9]+$" data-validation-msg="[%pack:article_pack-espcms_keywords_optimization_keywordname_validation_msgerr%]" value="0"/>
									<ul class="input_group_list" id="item_list"></ul>
									<div class="add_one"><a class="btn-round-xm btn-orange" id="add_item"><i class="espcms_icon_fa espcms_icon_fa-plus-circle espcms_icon_fa-14"></i>[%pack:botton_pack-espcms_botton_bat_add%]</a></div>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">[%pack:article_pack-espcms_article_model_title%]</label>
								<div class="col-sm-9">
									<select class="selectpicker form-control" name="mid" id="mid" data-size="8" title="[%pack:article_pack-espcms_article_model_mid_title%]" data-validation="^[1-9]{1}[0-9]*$" data-validation-msg="[%pack:article_pack-espcms_article_model_mid_validation_msg%]">
										[%forlist from=$model_list key=i%]
										<option value="[%$model_list[i].mid%]">[%$model_list[i].modelname%]</option>
										[%/forlist%]
									</select>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">[%pack:article_pack-espcms_keywords_optimization_islink%]</label>
								<div class="col-sm-9 pt5">
									<input type="radio" name="islink" id="islink" class="tab_click" open_list=".islink_div" value="1"/><span class="pr10">[%pack:article_pack-espcms_keywords_optimization_islink_1%]</span>
									<input type="radio" name="islink" id="islink" class="tab_click" close_list=".islink_div" value="0" checked/><span class="pr10">[%pack:article_pack-espcms_keywords_optimization_islink_0%]</span>
								</div>
							</div>
							<div class="form-group islink_div displaynone">
								<label class="col-sm-2 control-label">[%pack:article_pack-espcms_keywords_optimization_linkurl%]</label>
								<div class="col-sm-9">
									<input type="text" name="linkurl" class="form-control" id="linkurl" maxlength="200" data-validation="^((https|http|ftp|rtsp|mms)?:\/\/)[^\s]+$" link-validation="islink" link-gettype="radio" link-getvalue="1" placeholder="[%pack:article_pack-espcms_keywords_optimization_linkurl_title%]" title="[%pack:article_pack-espcms_keywords_optimization_linkurl_title%]" data-validation-msg="[%pack:article_pack-espcms_keywords_optimization_linkurl_validation_msg%]"/>
								</div>
							</div>
							<div class="form_button">
								<button type="submit" class="btn btn-green min-w-150" formmethod="POST">[%pack:botton_pack-espcms_botton_save_ok%]</button>
								<button type="button" class="btn btn-lightgray min-w-150 espcms_save_cancel">[%pack:botton_pack-espcms_botton_save_cancel%]</button>
							</div>
						</form>
					</div>
				</div>

			</div>
		</div>
		[%link file="public/load.html"%]
		[%link file="public/load_height.html"%]
	</body>
</html>
